﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AMS.Core;
using AMS.Core.Data;
using AMS.DD35.DbAccess.SqlClient;
using AMS.Core.Services;
using AMS.DD35.DbAccess;
using AMS.DD35.Common;
using AMS.DD35.ServiceLib.Services;

namespace AMS.DD35.ServiceLib
{
    public class IoCCSetup
    {
        public IoCCSetup()
        { }

        // I can't actually call this anywhere!
        public SimpleIoCC SetupUpIoCC()
        {
            SimpleIoCC container = new SimpleIoCC();
            container.Register<IConfiguration>(new Configuration());
            container.Register<ISessionService>(new SessionService());
            container.Register<ILoginConnector>(new SqlEDMLoginConnector());
            container.Register<IRegisterConnector>(new SqlEDMRegisterConnector());
            container.Register<ICharacterConnector>(new SqlEDMCharacterConnector());
            container.Register<IStaticLookupConnector>(new SqlEDMStaticLookupConnector());
            container.Register<ILoginService>(new LoginService(container.GetService<ILoginConnector>(), container.GetService <ISessionService>()));
            container.Register<IRegisterService>(new RegisterService(container.GetService <IRegisterConnector>()));
            container.Register<ICharacterService>(new CharacterService(container.GetService<ICharacterConnector>(), container.GetService<ISessionService>()));
            container.Register<IStaticLookupService>(new StaticLookupService(container.GetService<IStaticLookupConnector>(), container.GetService<ISessionService>()));

            return container;
        }
    }
}
